package com.coderlin1.service.impl;

import com.coderlin1.entities.Account;
import com.coderlin1.mapper.AccountMapper;
import com.coderlin1.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * <Description> <br>
 *
 * @author Coder_Lin<br>
 * @version 1.0<br>
 * @taskId: <br>
 * @createDate 2021/07/29 23:10 <br>
 * @see com.coderlin1.service.impl <br>
 */
@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountMapper accountMapper;
    /**
     * 根据用户输入姓名查询数据库对应用户信息
     *
     * @param userName
     * @return
     */
    @Override
    public Boolean login(String userName, String userPwd) {
        Account account = accountMapper.login(userName);
        if(null == account){
            return false;
        }
        if(Objects.equals(userPwd,account.getUserPwd())){
            return true;
        }else {
            return false;
        }
    }
}
